<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <include file="Public:easyui_res" />
    </head>
    <body >
	<div class="easyui-panel" title="{$title}" style="width:100%;">
		<div style="padding:10px 60px 20px 60px">
	    <form id="ff" method="post" action="__URL__/edit">
	    		<table cellpadding="5">
	    			<tr>
	    			<td>账号类型:</td>
	    			<td>
	    			<select class="easyui-combobox" name="type" disabled="disabled">
	    			<option value="1">药店</option>
					<option value="2">品牌</option>
	    			</select>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td>登陆ID:</td>
	    			<td><input class="easyui-textbox" type="text" name="pharmacy_id"  readonly="readonly" ></input></td>
	    		</tr>
	    		<tr>
	    			<td>药店名 ：</td>
	    			<td><input class="easyui-textbox" type="text" name="pharmacy_name"  data-options="required:true" ></input></td>
	    		</tr>
	    		<tr>
	    			<td>所属品牌：</td>
	    			<td>
	    			<select class="easyui-combobox" name="brand_id" id="brand_id" data-options="required:true">
					<volist name="brand_info" id="vo" >
					<option value="{$vo.brand_id}">{$vo.brand_name}</option>
					</volist>
	    			</select>
					</td>
	    		</tr>
	    		<tr>
	    			<td>药店登陆密码：</td>
	    			<td><input class="easyui-textbox" type="text" name="phy_password"   data-options="prompt:'不修改密码请置空'"  ></input></td>
	    		</tr>
	    		<tr>
	    			<td>后台登陆密码：</td>
	    			<td><input class="easyui-textbox" type="text" name="ad_password"   data-options="prompt:'不修改密码请置空'"  ></input></td>
	    		</tr>
	    		</table>
	    		<div style="display: none">
			    </div>
	    	</form>
	    		
	     <div style="padding:5px">
	     	<a href="javascript:void(0);" class="easyui-linkbutton"  onclick="submitForm()" data-options="iconCls:'icon-add'" style="width:100px;height:32px">保存</a>
	      <a href="#" class="easyui-linkbutton" iconCls="icon-undo" style="width:100px;height:32px" onclick="javascript:window.location.href='__URL__/index'">返回</a>
	    </div>
	    </div>
	</div>
	<script>
		function submitForm(){
			$('#ff').form('submit',{
				onSubmit:function(){
					var data = form2Json("ff");
					var form_valid = $(this).form('enableValidation').form('validate');
					if(!form_valid ){
						return false; 
					}
					data["brand_name"] =$("#brand_id").combobox('getText');
					 $.post("__URL__/edit/"+Math.random(),data, function(data) {
			             if (data >0) {
			            	 $.messager.alert("提示","操作成功");
			             }else{
			            	 $.messager.alert("提示","操作失败");
			             }
			         });
					 return false;
				}
			});
		}
		$(function(){
			$('#ff').form('load', {$data});			
		});

	</script>
	
    </body>
</html>

